#ifndef NET_TCP_SERVER_H_
#define NET_TCP_SERVER_H_

#include "TcpSession.h"




namespace mp_net
{
	class TcpServer : public TcpSession
	{
	public:
		TcpServer():TcpSession(){m_acceptor = NULL;
			m_accepting = false;}
		virtual ~TcpServer();

		void ThreadInitialization();
		void ThreadUpdate();
		void ThreadShutdown();

		void SetIoService(spIoService ioService);

		void AsyncAccept();
		void AsyncAcceptProc(
			const boost::system::error_code& error);

	private:
		//void UpdateSockets();
		void UpdateAcceptor();

		tcp::acceptor*	m_acceptor;
		volatile bool	m_accepting;
	};
}
#endif